<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<title>电子警察拍摄车辆违法信息查询</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="绍兴车辆违章查询,绍兴汽车违章查询,绍兴市交警信息网">
<meta http-equiv="description" content="This is my page">
<style>
<!--
body{
    font-family:Arial, Helvetica, sans-serif ;
    font-size:12px;

    padding: 10px;
    margin:0 auto;
    text-align:center;
    color:#000;
}
img,ul,li,form,td,tr,dl,dt,dd,p{
    border:0;
    margin:0;
    padding:0;
    list-style: none;}
a:link,
a:visited{
    color:#0c5ca7;
    text-decoration:none;
}
a:hover,
a:active{
    color:#c00;
    text-decoration:underline;
}
div{text-align:left;}

tr{vertical-align:top;}

.fb{font-weight:bold;}

.mid{text-align:center;}

.clear{clear:both;}

.mar5{margin-top:5px;}

.mar10{margin-top:10px;}

.mar15{margin:0 15px;}

.f14{font-size:14px;}

.rit{text-align:right;}

.blue{color:#004079; }

.red{color:#e00 !important;}

.floatR{float:right;}

.floatL{float:left;}
.more{
    float:right;
    font-weight:normal !important;
    padding-right:5px;
    font-size:12px !important;
}

/*----------------------main page start--------------------*/
.mainLeft{
    width:233px;
    float:left;
}
.mainRight{
    width:709px;
    float:right;
}
/*----------------Nav-------------*/
#Navmain{
    text-align:right;
    padding-right:20px;
}
.nav{
    display:inline-block;
    *display:inline;
    zoom:1;
}
.nav li{
    float:left;
    font-size:14px;
    padding:10px 20px 8px;
}
.nav a:link,
.nav a:visited{
    color:#e1f0fb;
}
.nav a:hover,
.nav a:active{
    color:#fc0;}
.noBg{
    background:none !important;}
.current{
    color:#fc0 !important;
}

.search{

    padding:10px 20px 10px 30px;
    color:#7b8e9f;
    height:15px;
}
.searchImg img{
    margin:0 0 -3px 3px;}
.searchInput{height:17px; border:1px solid #c7ced5;}
/*-------------------container--------------*/

/*--------left---------*/
.quicy{
    background:url(http://wscgs.sxga.gov.cn/Images/sx_car_21.gif) repeat-y;
}
.quicy ul{
    padding-left:10px;
}
.quicy li{
    float:left;
    text-align:center;
    margin:5px 5px ;
    width:125px;
}
.quicy a:link,
.quicy a:visited{
    color:#002950;
}
.quicy a:hover,
.quicy a:active{
    color:#f00;}
.subject dl{
    float:left;
    width:350px;
    margin:10px 0 0;
}
.news{
    margin:10px 0 0;
}
.marRight{margin-right:9px !important;}
.subject dt,.news dt{
    background:url(http://wscgs.sxga.gov.cn/Images/sx_car_27.gif) no-repeat top right;
    font-size:14px;
    color:#0157ac;
    padding:7px 10px 4px 0;
}
.subject dt span,.news dt span{
    background:url(http://wscgs.sxga.gov.cn/Images/sx_car_26.gif) no-repeat top left;
    padding:8px 0 4px 25px;
    font-weight:bold;
}
.subject dd,.news dd{
    border:solid #a9cbee;
    border-width:0 1px 1px 1px;
    padding:5px 5px 10px;
}
.subject dd li,.news dd li{
    background:url(http://wscgs.sxga.gov.cn/Images/sx_car_63.gif) no-repeat 5px 13px;
    border-bottom:1px dashed #ccc;
    padding:5px 4px 5px 15px;
}
.subject dd a:link,
.subject dd a:visited{
    color:#333;
}
.subject dd a:hover,
.subject dd a:active{
    color:#f00;
}
.maks dd{
    background:url(http://wscgs.sxga.gov.cn/Images/readBg.gif) repeat-x !important;
}
.maks dd li{
    background:none;
    border:none;
    float:left;
    padding:0;
    text-align:center;
}
.maks dd li img{
    margin-bottom:5px;}
/*---------right---------*/
.login{
    border:1px solid #aacaf0;
    background:url(http://wscgs.sxga.gov.cn/Images/sx_car_22.gif) no-repeat;
    padding:40px 10px 5px;
}
.loginMsg{
    background:url(http://wscgs.sxga.gov.cn/Images/sx_car_23.gif) no-repeat;
    border:1px solid #aacaf0;
    padding:40px 20px 10px;
}
.loginMsg a:link,
.loginMsg a:visited{
    text-decoration:underline;
}

.login td,.column dd td,.loginMsg td{
    padding:5px 0 5px 5px;}
.loginBt{
    padding:65px 0 22px;
}
.column dt{
    background:url(http://wscgs.sxga.gov.cn/Images/sx_car_50.gif) no-repeat;
    padding:9px 15px 5px 25px;
    color:#d2e4f4;
    font-weight:bold;
}
.column dd{
    border:1px solid #aacaf0;
    background:#eaf1f7;
    padding:10px 0 10px;
}
.bt{
    background:url(http://wscgs.sxga.gov.cn/Images/sx_car_71.gif) repeat-x 0 0;
    padding:1px 0 0 0;
    border-left:1px solid #7fc4ec;
    border-top:1px solid #7fc4ec;
    border-right:1px solid #409ace;
    border-bottom:1px solid #295f95;
    margin-right:5px;
    color:#000;
}
.rightStyle li{
    border:1px solid #aacaf0;
    margin:3px 0;}
.footer{
    background:url(http://wscgs.sxga.gov.cn/Images/footer.gif) repeat-x 0 0;
    padding:12px 0 18px;
    margin-top:15px;
    line-height:23px;
}
/*-------other----------*/
.position{
    background:url(http://wscgs.sxga.gov.cn/Images/icon4.gif) #eee no-repeat 9px 9px ;
    padding:10px 14px 10px 30px;
}
.detailTitle{
    border-bottom:1px dashed #ccc;
    color:#c00;
    padding:15px 0;
}
.detail{
    text-indent:2em;
    line-height:23px;
    padding:10px;
}
.overfw{
    width:690px;
    height:740px;
    overflow-x:hidden;
    overflow-y:auto;
}
/*---------------search------------*/
.search2{
    padding:25px 0;
    text-align:center;

}
.search2 input,
.search2 img{
    vertical-align:middle;}
.search2 input{
    width:250px;
    color:#999;
    padding-top:2px;
    border:1px solid #7d9bba;
    margin:0 5px;
}
.lineTop{
    background:#d2def0;
    border-top:3px solid #7eaac8;
    color:#000;
    padding:3px 10px;
    text-align:right;
}
.white{color:#fff;}
.search_in{
    text-align:left;
    padding:10px 10px 0;
    line-height:21px;
    border-bottom:1px dashed #ddd;
}
.search_in dt{
    font-size:14px;
    font-weight:bold;
    color:#1460ae;
}
.gray{color:#999;}
.lineBottom{
    background:#d9dfe8;
    border-top:1px solid #c4ccd7;
    padding:3px 10px;
    margin:10px 0;
}
.page{
    float:right;
}
.page a{
    padding:0 2px;
}
.police{
    border:1px solid #abcbf1;
    padding:1px;
    color:#823101;
}
/*--------------wrong-------------*/
.xt_wrong{
    background:url(http://wscgs.sxga.gov.cn/Images/cw.jpg) no-repeat center top;
    height:340px;
    width:370px;
    line-height:25px;
    margin:50px 0 10px;
    padding:10px 150px 0 90px;
}
.wrongBt{
    height:75px;}
.wrongTop{
    height:130px;
    color:#fff;
}
.wrongBegin{
    padding-right:35px;}

.diaryTable{
    border-left:1px solid #ccc;
    border-top:1px solid #ccc;
    color:#000;
    line-height:21px;
    background:#fff;
}
.diaryTable td{
    padding:3px 3px 3px 5px;
    border-right:1px solid #666;
    border-bottom:1px solid #666;
}
.Table-top{
    background:#dcecf3;
    height:20px;
    font-weight:bold;
}
.tr {
    background-color: expression((this.sectionRowIndex%2==0)? '#eee':'#fff');
    height: 20px;
}


/*-------------------*/
DIV.hzcd {
    PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; MARGIN: 3px; PADDING-TOP: 3px; TEXT-ALIGN: center
}
DIV.hzcd A {
    BORDER-RIGHT: #fff 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #fff 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 2px; MARGIN: 2px; BORDER-LEFT: #fff 1px solid; COLOR: #000099; PADDING-TOP: 2px; BORDER-BOTTOM: #fff 1px solid; TEXT-DECORATION: underline
}
DIV.hzcd A:hover {
    BORDER-RIGHT: #000099 1px solid; BORDER-TOP: #000099 1px solid; BORDER-LEFT: #000099 1px solid; COLOR: #000; BORDER-BOTTOM: #000099 1px solid
}
DIV.hzcd A:active {
    BORDER-RIGHT: #000099 1px solid; BORDER-TOP: #000099 1px solid; BORDER-LEFT: #000099 1px solid; COLOR: #f00; BORDER-BOTTOM: #000099 1px solid
}
DIV.hzcd SPAN.current {
    BORDER-RIGHT: #fff 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #fff 1px solid; PADDING-LEFT: 5px; FONT-WEIGHT: bold; PADDING-BOTTOM: 2px; MARGIN: 2px; BORDER-LEFT: #fff 1px solid; COLOR: #000; PADDING-TOP: 2px; BORDER-BOTTOM: #fff 1px solid; BACKGROUND-COLOR: #fff
}
DIV.hzcd SPAN.disabled {
    BORDER-RIGHT: #eee 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #eee 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 2px; MARGIN: 2px; BORDER-LEFT: #eee 1px solid; COLOR: #ddd; PADDING-TOP: 2px; BORDER-BOTTOM: #eee 1px solid
}
.kpdetail{
    background:#eaf1f7;
    border:1px solid #c9dfee;
    padding:10px;
}
.kpdetail td{
    padding:5px;
}
-->
</style>
</head>

<body>
<?php
//POST数据，获取COOKIE,cookie文件放在网站的temp目录下
$login_url="http://wscgs.sxga.gov.cn/index1.jsp";
$cookie_file = tempnam('./bbs/temp','cookie');

$url='http://wscgs.sxga.gov.cn/viocheck/viocheck.do?act=Vehviohlist';
$url1='http://www.sxga.gov.cn:82/ids/LoginServlet?coAppName=Y2R0d3NjZ3M=&coSessionId=Q0QxMTU0MTZFM0VCQTk1NjlDMkRGREJBMDA4NUI4RDk=&surl=aHR0cDovL3dzY2dzLnN4Z2EuZ292LmNuLz9jPTE=';

//目标来源页面
$referer='http://wscgs.sxga.gov.cn/';

/*模拟用户登陆，获取Cookies*/
$ch = curl_init($login_url);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1); // 自动设置Referer
curl_setopt($ch, CURLOPT_HTTPGET, 1); // 发送一个常规的GET请求
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转
curl_setopt($ch, CURLOPT_COOKIESESSION,1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
$c = curl_exec($ch);
curl_close($ch);
//echo $c;

/*登陆完毕*/
preg_match_all( '/Set-Cookie:\s*.+?Path=\//m',$c,$regs);
$str1=str_replace("Path=/","",str_replace("Set-Cookie: ","",$regs[0][0]));
$str2=str_replace("Path=/","",str_replace("Set-Cookie: ","",$regs[0][1]));
$str=str_replace(" ","",$str1 . $str2);


$hpzl=$_GET["hpzl"];
$fzjgjc=urlencode(mb_convert_encoding($_GET["fzjgjc"], "GB2312", "UTF-8"));
$hphm=$_GET["hphm"];
//$clsbdh=$_POST["clsbdh"];
$fdjh=$_GET["fdjh"];


//	$hpzl="02";
//	$fzjgjc=urlencode("浙");
//	$hphm="D2E219";
//	$clsbdh="LVSHEFEK37F352016";2015年后被弃用
//   $fdjh="102564";
//将$post_data中写入你所截取的数据包，可以使用Winsock Expert截取数据包
$post_data='hpzl='.$hpzl.'&fzjgjc='.$fzjgjc.'&hphm='.$hphm.'&fdjh='.$fdjh;

//	$str3=substr($result,strpos($result,"com.trs.idm.gSessionId=") + strlen("com.trs.idm.gSessionId="),100);
//	$str4=substr($str3,0,strpos($str3,""));
//	echo $str3."<br />";
//	echo $str4;
//exit();
//	

$header=array( //发送header
    'Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7',
    'Cookie: '.$str,
    'Referer: http://wscgs.sxga.gov.cn/',
    'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
    'Connection: keep-alive',
    'Keep-Alive: 115',
    'Accept-Encoding: gzip,deflate',
    'Accept-Language: zh-cn,zh;q=0.5',
    'content-type: application/x-www-form-urlencoded',
    'Host: wscgs.sxga.gov.cn',
    'Pragma: no-cache',
    'Cache-Control: no-cache'
);

//注册站点
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_REFERER, $referer);       //伪装REFERER
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转
curl_setopt($ch,CURLOPT_HTTPHEADER,$header); //发送header
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_COOKIESESSION,1);
$result = curl_exec($ch);
$content = mb_convert_encoding($result, "UTF-8", "GB2312");
curl_close($ch);

?>

<div class="search">
    <div id="timerDiv" class="floatL"><?=date("Y-m-d h:i")?></div>
    <div class="floatR searchImg">
        <span style="color: red;">引用信息来源：绍兴公安网上车管所&nbsp;&nbsp;版权所有：<a href="http://wscgs.sxga.gov.cn/" target="_blank">http://wscgs.sxga.gov.cn/</a></span>
    </div>
    <div class="clear"></div>
</div>
<?php

echo substr($content,strpos($content,'<div class="login_main">'),strpos($content,'</div></div>')-strpos($content,'<div class="login_main">'));
//清理cookie文件
//unlink($cookie_file);


?>
</body>
</html>
                            